﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PPIDesktopClient.Entities.Kml;
using PPIDesktopClient.Logic;
using PPIDesktopClient.Interface;

namespace PPIDesktopClient.Entities
{
    public class EDistancePositions : IGoogleEarth
    {
        private EBasePosition m_PositionOne;
        private EBasePosition m_PositionTwo;
        public EBasePosition PositionOne
        {
            get
            {
                return m_PositionOne;
            }
            set
            {
                m_PositionOne = value;
            }
        }
        public EBasePosition PositionTwo
        {
            get
            {
                return m_PositionTwo;
            }
            set
            {
                m_PositionTwo = value;
            }
        }

        public EDistancePositions()
        {
            m_PositionOne = new EBasePosition();
            m_PositionTwo = new EBasePosition();
        
        }

        public EDistancePositions(EBasePosition positionOne, EBasePosition positionTwo)
        :this()
        {
            m_PositionOne = positionOne;
            m_PositionTwo = positionTwo;
        }

        public EKmlFile ToKml()
        {
            return LDistancePositions.toKml(this);
        }

        public bool IsEmpty()
        {
            return (PositionOne.Latitude == Double.MinValue || PositionOne.Longitude ==  Double.MinValue
                    || PositionTwo.Longitude == Double.MinValue || PositionTwo.Latitude == Double.MinValue);
        }

    }
}
